package com.yh.patterns.factory.factory_method;

/**
 * @Auther:云尚学Java
 */
public class Client {
    public static void main(String[] args) {
        //创建咖啡店对象
        CoffeeStore store=new CoffeeStore();
        //创建工厂对象
        CoffeeFactory factory=new AmericanCoffeeFactory();
        //CoffeeFactory factory=new LatteCoffeeFactory();
        store.setFactory(factory);
        //点咖啡
        Coffee coffee = store.orderCoffee();
        System.out.println(coffee.getName());
    }
}
